import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children: [
      {
        path: '/',
        component: () => import('../views/message/RecommendedMsgView.vue')
      },
      {
        path: 'new',
        component: () => import('../views/message/NewMessageView.vue')
      },
      {
        path: 'qas',
        component: () => import('../views/message/QASView.vue')
      }
    ]
  },
  {
    path: '/detail',
    name: 'UserDetailView',
    component:() =>  import('../views/user/UserDetailView.vue')
  },
  {
    path: '/quill',
    name: 'RichTextEditor',
    component:() =>  import('../components/RichTestEditor.vue')
  },
  {
    path: '/avator',
    name: 'Avator',
    component:() =>  import('../components/Avator.vue')
  },
  {
    path: '/backstage',
    name: 'AdminHomeView',
    component:() =>  import('../views/AdminHomeView.vue'),
    children: [
      {
        path: '/admin/index',
        component: () => import('../views/admin/AdminIndexView.vue')
      },
    ]
  },
  {
    path: '/content/quill',
    name: 'MessageQuillArticle',
    component:() =>  import('../views/content/RitchTestArticle.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
